package com.example.mynetwork2.mvpdesign2.presenter;

import com.example.mynetwork2.mvpdesign2.model.FanyiModel;
import com.example.mynetwork2.mvpdesign2.view.IFanyiView;

public class CidianPresenter implements ICidianPresenter {
    IFanyiView fanyiView;
    FanyiModel fanyiModel;
    public CidianPresenter(IFanyiView fanyiView){
        this.fanyiView= fanyiView;
        fanyiModel = new FanyiModel();
    }

    @Override
    public void inputToModel(String input) {
      fanyiModel.handleData(input,this);
    }

    @Override
    public void onSuccess(String str) {
        fanyiView.setInfo(str);

    }

    @Override
    public void onError() {
     fanyiView.setError();
    }
}
